package com.cx.service.impl;

import com.cx.mapper.SeriesMapper;
import com.cx.pojo.Series;
import com.cx.service.SeriesService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class SeriesServiceImpl implements SeriesService {
    @Autowired
    SeriesMapper seriesMapper;

    //添加车系
    @Override
    public int insert(Series series) {
        return seriesMapper.insert(series);
    }

    //修改车系
    @Override
    public int updateByPrimaryKey(Series series) {
        return seriesMapper.updateByPrimaryKey(series);
    }

    //根据id删除车系
    @Override
    public int deleteByPrimaryKey(Integer seriesId) {
        return seriesMapper.deleteByPrimaryKey(seriesId);
    }

    //根据id查询车系
    @Override
    public Series selectByPrimaryKey(Integer seriesId) {
        return seriesMapper.selectByPrimaryKey(seriesId);
    }

    //查询所有车系
    @Override
    public List<Series> selectAll(Series series) {
        List<Series> seriesList = seriesMapper.selectAll(series);
        return seriesList;
    }

    @Override
    public Series selectSeries(String seriesName) {
        Series series= seriesMapper.selectSeries(seriesName);
        return series;
    }
}
